package com.linxz.utils;

import android.text.Editable;
import android.widget.EditText;

import com.linxz.utils.interfaces.TextWatcher;

/**
 * @author Linxz
 * 创建日期：2019年10月06日 09:20
 * version：v4.5.4
 * 描述：
 */
public class EditTextUtils {

    public static void addTextChangedListener(EditText editText,final TextWatcher watcher){
        editText.addTextChangedListener(new android.text.TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {
                watcher.onTextChanged(s,start,before,count);
            }

            @Override
            public void afterTextChanged(Editable s) {

            }
        });

    }
}
